using System.IO;

namespace winsw
{
	public class RollingLogAppender : SimpleLogAppender
	{
		public RollingLogAppender(string logDirectory, string baseName)
			: base(logDirectory, baseName, FileMode.Append)
		{
		}

		public override void log(Stream outputStream, Stream errorStream)
		{
			CopyFile(base.OutputLogFileName, base.OutputLogFileName + ".old");
			CopyFile(base.ErrorLogFileName, base.ErrorLogFileName + ".old");
			base.log(outputStream, errorStream);
		}
	}
}
